home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Resources / Partition Logic 0.61 / partlogic-0.61.iso / system / headers / stdlib.h < prev    next >
C/C++ Source or Header  |  2006-01-31  |  2KB  |  79 lines

  1. // 
  2. //  Visopsys
  3. //  Copyright (C) 1998-2006 J. Andrew McLaughlin
  4. //  
  5. //  This library is free software; you can redistribute it and/or modify it
  6. //  under the terms of the GNU Lesser General Public License as published by
  7. //  the Free Software Foundation; either version 2.1 of the License, or (at
  8. //  your option) any later version.
  9. //
  10. //  This library is distributed in the hope that it will be useful, but
  11. //  WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
  13. //  General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU Lesser General Public License
  16. //  along with this library; if not, write to the Free Software Foundation,
  17. //  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. //  stdlib.h
  20. //
  21.  
  22. // This is the Visopsys version of the standard header file stdlib.h
  23.  
  24. #if !defined(_STDLIB_H)
  25.  
  26. #include <stddef.h>
  27. #include <limits.h>
  28.  
  29. #define EXIT_FAILURE  -1
  30. #define EXIT_SUCCESS  0
  31. #define MB_CUR_MAX    MB_LEN_MAX
  32. #define RAND_MAX      UINT_MAX
  33.  
  34. #ifndef NULL
  35. #define NULL 0
  36. #endif
  37.  
  38. // We're supposed to define size_t here???  Same with wchar_t???  I thought
  39. // they were defined in stddef.h.  Oh well, we're including stddef.h anyway.
  40.  
  41. // Functions
  42. void abort(void);
  43. int abs(int);
  44. int atoi(const char *);
  45. void *_calloc(size_t, size_t, const char *);
  46. #define calloc(num, size) _calloc(num, size, __FUNCTION__)
  47. void exit(int);
  48. void _free(void *, const char *);
  49. #define free(ptr) _free(ptr, __FUNCTION__)
  50. long int labs(long int);
  51. void *_malloc(size_t, const char *);
  52. #define malloc(size) _malloc(size, __FUNCTION__)
  53. int mbtowc(wchar_t *, const char *, size_t);
  54. size_t mbstowcs(wchar_t *dest, const char *src, size_t n);
  55. int rand(void);
  56. void *_realloc(void *, size_t, const char *);
  57. #define realloc(ptr, size) _realloc(ptr, size, __FUNCTION__)
  58. void srand(unsigned int);
  59. int system(const char *);
  60. int wctomb(char *, wchar_t);
  61.  
  62. // Not sure where else to put these
  63. #define max(a, b) ((a) > (b) ? (a) : (b))
  64. #define min(a, b) ((a) < (b) ? (a) : (b))
  65.  
  66. // Argh.  Aren't there functions that do these?  These are andy-special.
  67. void itoa(int, char *);
  68. void itob(int, char *);
  69. void itox(int, char *);
  70. void lltoa(long long, char *);
  71. void lltob(long long, char *);
  72. void lltox(long long, char *);
  73. int xtoi(const char *);
  74. void ulltoa(unsigned long long, char *);
  75. void utoa(unsigned int, char *);
  76.  
  77. #define _STDLIB_H
  78. #endif
  79.